/*************************************************************
 * File: UserResource.java
 * Copyright (c) 2012
 * Author: Huang Shaobin
 * Email: Shaobin.Software@gmail.com Shaobin_Software@163.com 
 * Date: Feb 11, 2013
 * Description: 
 ************************************************************/

package snow.biz.system.web.resource;

import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

import snow.biz.system.service.IUserService;
import snow.biz.system.web.SystemWebConstants;
import snow.core.security.Operation;
import snow.core.security.OperationType;
import snow.core.security.Resource;
import snow.core.web.restlet.ResourceSupport;

/**
 * 用户管理资源类
 * 
 * @author Shaobin.Software@gmail.com Shaobin_Software@163.com
 * @version 1.0
 */
@Path(SystemWebConstants.PATH_USERS)
@Resource(uri = SystemWebConstants.RESOURCE_USERS, name = "用户资源", desc = "用户资源")
public class UserResource extends ResourceSupport {

	private IUserService userService;

	@POST
	@Operation(OperationType.MODIFY)
	@Produces(MediaType.APPLICATION_JSON)
	public Object addUser() {
		return null;
	}

	@DELETE
	@Path("/{id:\\d+}")
	@Operation(OperationType.REMOVE)
	@Resource(uri = "/{id:\\d+}", name = "删除用户", desc = "删除用户")
	@Produces(MediaType.APPLICATION_JSON)
	public Object delUser(@PathParam("id")
	Integer id) {
		return null;
	}

	public IUserService getUserService() {
		return this.userService;
	}

	@GET
	@Operation(OperationType.SEARCH)
	@Produces(MediaType.APPLICATION_JSON)
	public Object listUser() {
		return null;
	}

	@PUT
	@Path("/{id:\\d+}")
	@Operation(OperationType.MODIFY)
	@Resource(uri = "/{id:\\d+}", name = "删除用户", desc = "删除用户")
	@Produces(MediaType.APPLICATION_JSON)
	public Object modUser(@PathParam("id")
	Integer id) {
		return null;
	}

	public void setUserService(IUserService userService) {
		this.userService = userService;
	}

	@GET
	@Path("/{id:\\d+}")
	@Operation(OperationType.SEARCH)
	@Resource(uri = "/{id:\\d+}", name = "用户明细", desc = "用户明细")
	@Produces(MediaType.APPLICATION_JSON)
	public Object showUser(@PathParam("id")
	Integer id) {
		return null;
	}
}
